package acwing_01;
import java.io.*;
import java.util.*;
public class _797_差分 {
	static int N = 100010;
	static int n,m;
	static int arr[] = new int[N];
	static int d[] = new int[N];
	static int l,r,c;
	public static void main(String[] args) throws IOException{
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
		StringTokenizer st = new StringTokenizer(br.readLine());
		n = Integer.parseInt(st.nextToken());
		m = Integer.parseInt(st.nextToken());
		
		st = new StringTokenizer(br.readLine());
		for(int i = 1; i <= n; i++) {
			arr[i] = Integer.parseInt(st.nextToken());
			// 构造差分数组，原理是减去前一个arr[i]，加上当前arr[i]
			// d[i] += arr[i];
			// d[i+1] -= arr[i]; 
			d[i] = d[i] - arr[i-1] + arr[i];
		}
		
		for(int i = 0; i < m; i++) {
			st = new StringTokenizer(br.readLine());
			l = Integer.parseInt(st.nextToken());
			r = Integer.parseInt(st.nextToken());
			c = Integer.parseInt(st.nextToken());
			d[l] += c;
			d[r+1] -= c;
		}
		
		for(int i = 1; i <= n; i++) {
			d[i] += d[i - 1];
			bw.write(d[i] + " ");
		}
		
		
		bw.flush();
		br.close();
		bw.close();
		
		
		
	}
}
